<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" type="image/png" href="http://airtest.netease.com/static/img/icon/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>测试结果汇总</title>
  </head>
  <style type="text/css">
    *{
      margin: 0;
      padding: 0;
    }
    body{
      background: #eeeeee
    }
    .container {
      width: 90%;
      min-width: 800px;
      margin: auto
    }
    body.zh .en{
      display: none;
    }
    body.en .zh{
      display: none;
    }
    h1{
      margin-top: 50px;
      text-align: center;
    }
    .center{
      text-align: center;
      margin-top: 15px;
      margin-bottom: 30px;
      font-size: 14px;
      position: relative;
    }
    .btn{
      border: solid 1px #c0c0c0;
      padding: 5px 20px;
      border-radius: 3px;
      background: white;
      cursor: context-menu;
    }
    .btn.lang:hover {
      background: #5cb85c26;
      border-color: #0a790a;
    }
    .btn.lang {
      position: absolute;
      top: 0;
    }
    .head {
      margin: 20px 0 30px 0;
    }
    .head, .table{
      background: white;
      border-radius: 5px;
      box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
      padding: 30px 20px;

    }
    .head .progress{
      background: #dddddd;
      color: white;
      border-radius: 5px;
      text-align: center;
      margin-top: 12px;
    }
    .head .progress-bar-success{
      width: 0;
      transition: all 0.5s ease;
      background: #5cb85c;
      border-radius: 5px;
    }
    .table-title {
      text-align: center;
      margin-bottom: 20px;
      font-size: 18px;
      font-weight: bold;
      position: relative;
    }
    .table-row{
      border: solid 1px #e5e5e5;
      margin-top: -1px;
      cursor: context-menu;
    }
    .table-row:hover, .table-row.active{
      background: beige;
    }
    .table-head{
      background: aliceblue;
    }
    .table-head:hover{
      background: aliceblue;
    }
    .table-head .table-col{
      padding-top: 10px;
      padding-bottom: 10px;
      font-weight: bold;
      text-align: center;
    }
    .table-col{
      display: inline-block;
      width: 200px;
      line-height: 30px;
      padding: 5px 10px;
      border-left: solid 1px #e5e5e5;
      margin-top: -1px;
      margin-right: -5px;
    }
    .table-col.short{
      width: 100px;
      text-align: center;
    }
    .table-col.mid{
      width: 200px;
      text-align: center;
    }
    .table-col:first-child{
      border: none;
    }
    .table-col.long{
      width: calc(100% - 700px);
    }
    .table-col.success{
      color: green;
    }
    .table-col.failed{
      color: red;
    }
    .detail{
      text-align: center;
      font-size: 14px;
      color: gray;
    }
    ::-webkit-scrollbar {
      width: 10px;
      height: 10px;
      background-color: rgba(0,0,0,.34);
    }
    ::-webkit-scrollbar-thumb {
      background-color: #8b8b8b;
      border-radius: 10px;
    }
    ::-webkit-scrollbar-track {
      background-color: #f5f5f5;
      -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.22);
    }

  </style>
  <body class="zh">
  <div class="container-fluid" >
    <div class="container">
      <div class="main">
        <div class="material">
          <h1>汇总报告</h1>
          <div class="center">
            <div class="time zh">开始时间：{{results.start_time}}，耗时 <b>{{results.total_time}}</b></div>
            <div class="time zh">测试模块：<b>{{results.modules}}</b></div>
            <div class="time zh">测试设备 ：<b>{{results.phone}}--{{results.dev}}</b></div>
          </div>
          <div class="head">
            <header class="zh"><span class="rate"></span>成功率：</span> {{results["success"]}}/{{results["count"]}}</header>
            <div>
              <div class="progress">
                <div class="progress-bar progress-bar-success" role="progressbar"  aria-valuemin="0" aria-valuemax="100" style="width: {{results['success'] *100 / results['count']}}%">
                  <span class="">{{'%0.2f' % (results["success"] *100 / results["count"])}}%</span>
                </div>
              </div>
          </div>
        </div>

        <div class="table" >
          <div class="table-title">
            <span class="running_detail zh">用例列表</span>
            <span class="running_detail en">Detail</span>
          </div>
          <div class="table-content" id="tab">
            <div class="table-row table-head">
              <div class="table-col short zh">序号</div>
              <div class="table-col short zh">状态</div>
              <div class="table-col mid zh">用例</div>
              <div class="table-col mid zh">耗时</div>
              <div class="table-col ">--</div>
            </div>
            {% set ns = namespace(found=0) %}
            {% for dat in results['data'] %}
              <div class="table-row" >
                {% set ns.found = ns.found + 1 %}
                <div class="table-col short">{{ns.found}}</div>
                <div class="table-col short zh {{'success' if dat.result else 'failed'}}">{{"成功" if dat.result else "失败"}}</div>
                <div class="table-col mid">{{dat['sum_time']}}</div>
<!--                <div class="table-col long">{{results.phone}}&#45;&#45;{{dat.phone}}</div>-->
                <div class="table-col detail zh">
                     <a href="{{dat.log}}/log.html" target="view_window">查看详情</a>
                </div>
              </div>
            {% endfor %}
          </div>
        </div>
      </div>
    </div>
  </body>

</html>